﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SPMS.Common;

namespace SPMS.Web.Models
{
    /// <summary>
    /// 封装形式数据模型
    /// </summary>
    [ModelBinder(typeof(ExtendedModelBinder))]
    public class PackagingModel
    {
        /// <summary>
        /// 获得或者设置封装形式编号。
        /// </summary>
        /// <value>
        /// 封装形式编号。
        /// </value>
        public Guid Packaging_ID
        {
            get;
            set;
        }

        /// <summary>
        /// 获得或者设置封装形式缩写。
        /// </summary>
        /// <value>
        /// 封装形式缩写。
        /// </value>
        [Display(Name = "引用缩写")]
        [Required(ErrorMessageResourceName = "text_error_field_required", ErrorMessageResourceType = typeof(SPMS.Web.Properties.Resources))]
        [StringLength(40, ErrorMessageResourceName = "text_error_field_max_length", ErrorMessageResourceType = typeof(SPMS.Web.Properties.Resources))]
        public string Packaging_Abbr
        {
            get;
            set;
        }

        /// <summary>
        /// 获得或者设置封装形式名称。
        /// </summary>
        /// <value>
        /// 封装形式名称。
        /// </value>
        [Display(Name = "封装名称")]
        [Required(ErrorMessageResourceName = "text_error_field_required", ErrorMessageResourceType = typeof(SPMS.Web.Properties.Resources))]
        [StringLength(40, ErrorMessageResourceName = "text_error_field_max_length", ErrorMessageResourceType = typeof(SPMS.Web.Properties.Resources))]
        public string Packaging_Name
        {
            get;
            set;
        }

        /// <summary>
        /// 获得或者设置封装形式备注。
        /// </summary>
        /// <value>
        /// 封装形式备注。
        /// </value>
        [Display(Name = "附加说明")]
        [StringLength(400, ErrorMessageResourceName = "text_error_field_max_length", ErrorMessageResourceType = typeof(SPMS.Web.Properties.Resources))]
        public string Memo
        {
            get;
            set;
        }

        /// <summary>
        /// 获得或者设置封装形式图片。
        /// </summary>
        /// <value>
        /// 封装信息图片。
        /// </value>
        [JsonBinder]
        public UploadFileModel[] Images
        {
            get;
            set;
        }
    }
}